<?php

/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
include_once('phpJasperXML/class/fpdf/fpdf.php');
include_once('phpJasperXML/class/tcpdf/tcpdf.php');
include_once("phpJasperXML/class/PHPJasperXML.inc.php");
include_once ('phpJasperXML/setting.php');
if( !function_exists('__autoload') )
{
    function __autoload($class_name) {
    require_once $class_name . '.php';
    }
}

$compraId = $_GET['compraId'];

$xml =  simplexml_load_file("reports/planilha.jrxml");



$PHPJasperXML = new PHPJasperXML();
$PHPJasperXML->debugsql=false;

$arrayParameter = array("idCompra"=>$compraId);
$PHPJasperXML->arrayParameter= $arrayParameter;
//
$PHPJasperXML->xml_dismantle($xml);

$PHPJasperXML->transferDBtoArray($server,$user,$pass,$db);
$PHPJasperXML->outpage("I");    //page output method I:standard output  D:Download file


?>